//
//  TYHLoginManager.h
//  OpenPractice
//
//  Created by tanyuehong on 7/7/18.
//  Copyright © 2018年  lijinghua. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "TYHUserEntity.h"



typedef void (^smsSecodCount)(NSInteger secodCount);     // 手机号验证码获取倒计时

UIKIT_EXTERN NSString *const kLoginNotification;
UIKIT_EXTERN NSString *const kLogoutNotification;

@interface TYHLoginManager : NSObject <Singleton>

@property (nonatomic, assign) BOOL isLogin;               // 当前是否登录
@property (nonatomic, strong) NSString *deviceId;
@property (nonatomic, strong, readonly) TYHUserEntity *currentUser;

- (NSString *)getUserTryLoginPhoneNum;                    // 记录用户尝试登录的手机号
- (void)setUserTryLoginPhoneNum:(NSString *)phoneNum;
- (BOOL)checkUserPhoneNumSendSms:(NSString *)phone secondBlock:(smsSecodCount)block;  // 读秒倒计时
- (void)checkPhoneNumberStatus:(NSString *)phoneNum compeletBlock:(completeBlock)block;
- (void)loginWithPhoneNum:(NSString *)phoneNum passWd:(NSString *)passWd compeletBlock:(completeBlock)block;
- (void)regiserWithPhoneCode:(NSString *)phoneNum code:(NSString *)code zone:(NSString *)zone compeletBlock:(completeBlock)block;

@end
